package bdz.projects.inl.vo
{
	import bdz.projects.inl.core.CoreVO;

	public class DownloadVO extends CoreVO
	{
		public var download_id:String;
		public var download_name:String;
		public var download_size:String;
		public var download_filename:String;
		public var download_index:String;
		public var download_type:String;
		public var folders:Array = new Array();
		public function DownloadVO(def:XML = null)
		{
			idField = "download_id";
			linkPairs = [
						{tree:"folders", node:"inl_download_folders", arr:"folders", vo:DownloadFolderVO}
						];
			if(def && def.name() != "inl_downloads"){
				def = def.inl_downloads[0];	
			}
			propList = ["download_id", "download_name", "download_size", "download_filename", "download_index", "download_type"];
			super(def, null, "inl_downloads");
		}
		override protected function createPropertyAttributes():void{
			propAttributes = [
			{name:"download_name", type:"input", label:"Name"},
			{name:"download_filename", type:"file", label:"File", ties:"download_size", tieprop:"size"},
			{name:"download_type", type:"selection", useoption:"combo", option:"public|private", label:"Type"},
			{name:"download_index", type:"stepper", label:"Order (index)"},
			
			{name:"folders", type:"dependency_list", vo:DownloadFolderVO, label:"Included in folders", list:"link", labelField:"download_folder_name", idField:"download_folder_id"}
			];
		}
		
	}
}